package cn.zjk.springframework.aop.aspectj;

import cn.zjk.springframework.aop.PointcutAdvisor;
import cn.zjk.springframework.aop.Pointcut;
import org.aopalliance.aop.Advice;

/**
 * @description:
 * @Author zjk
 * @className: AspectJExpressionPointcutAdvisor
 * @date: 2023/4/3 16:02
 */
public class AspectJExpressionPointcutAdvisor implements PointcutAdvisor {

    /**切面 */
    private AspectJExpressionPointcut pointcut;
    /*** 具体的拦截方法*/
    private Advice advice;
    /** 表达式*/
    private String expression;
    @Override
    public Pointcut getPointcut() {
        if(null == pointcut){
            pointcut = new AspectJExpressionPointcut(expression);
        }
        return pointcut;
    }

    public Advice getAdvice() {
        return advice;
    }

    public void setAdvice(Advice advice) {
        this.advice = advice;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }
}
